﻿using Bank.Account;
using Bank.Operations;
using Bank.Reports;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bank.Account
{
    public class DepositAccount : IAccount
    {
        private Decimal ballance;

        public Decimal Ballance
        {
            get { return ballance; }
            set { ballance = value; }
        }

        private Money ballance2;

        public Money Ballance2
        {
            get { return ballance2; }
            set { ballance2 = value; }
        }

        private Int32 id;

        public Int32 Id
        {
            get { return id; }
            set { id = value; }
        }

        private Int32 clientId;

        public Int32 ClientId
        {
            get { return clientId; }
            set { clientId = value; }
        }

        private String number;

        public String Number
        {
            get { return number; }
            set { number = value; }
        }

        private List<String> operationlist;

        public List<String> Operationlist
        {
            get { return operationlist; }
            set { operationlist = value; }
        }

        private IInterestCalculator interestCalculator;

        public IInterestCalculator InterestCalculator
        {
            set { interestCalculator = value; }
        }


        public DepositAccount(int _clientId, int _id)
        {

            Id = _id;
            ClientId = _clientId;
            Number = AccountHelper.GenerateAccountNumber();
            Ballance = 0;
            Ballance2 = new Money();
            Operationlist = new List<String>();

        }

        public DepositAccount(int _clientId, int _id, Decimal _ballance)
        {
            Id = _id;
            ClientId = _clientId;
            Number = AccountHelper.GenerateAccountNumber();
            Ballance = _ballance;
            Operationlist = new List<String>();
        }

        public DepositAccount(int _clientId, int _id, Money _ballance)
        {
            Id = _id;
            ClientId = _clientId;
            Number = AccountHelper.GenerateAccountNumber();
            Ballance2 = _ballance;
            Operationlist = new List<String>();
        }

        public void CalculateMyInterest()
        {
            interestCalculator.CalculateInterest(this);
        }
        public void Accept(IReport rep)
        {
            rep.Visit(this);
        }

        public void Accept2(IReport rep)
        {
            rep.Visit2(this);
        }
    }
}
